# -*- coding: utf-8 -*-
# main/web_driver_factory.py
from selenium import webdriver
from selenium.webdriver.edge.options import Options
from config import WEB_DRIVER_PATH


class WebDriverFactory:
    @staticmethod
    def create_webdriver():
        options = Options()
        # options.add_argument("--headless")
        options.page_load_strategy = "eager"
        options.add_argument("--blink-settings=imagesEnabled=false")
        options.add_argument("--disable-gpu")
        options.add_argument("--disable-extensions")
        options.add_argument("--no-sandbox")
        options.add_argument("--disable-dev-shm-usage")
        # options.add_argument('--disable-javascript')

        return webdriver.Edge(
            service=webdriver.EdgeService(executable_path=WEB_DRIVER_PATH),
            options=options,
        )
